package com.zws.cucumber.optimization.socket.oio;

import java.io.IOException;
import java.io.OutputStream;

public class ZwsSocketImplAdapterOutputStream extends OutputStream {

    private ZwsSocketImplAdapter adapter;

    public ZwsSocketImplAdapterOutputStream(ZwsSocketImplAdapter adapter) {
        this.adapter = adapter;
    }

    @Override
    public void write(int b) throws IOException {
        adapter.activeOutputStream().write(b);
    }

    @Override
    public void write(byte[] b) throws IOException {
        adapter.activeOutputStream().write(b);
    }

    @Override
    public void write(byte[] b, int off, int len) throws IOException {
        adapter.activeOutputStream().write(b, off, len);
    }

    @Override
    public void flush() throws IOException {
        adapter.activeOutputStream().flush();
    }

    @Override
    public void close() throws IOException {
        adapter.activeOutputStream().close();
    }
}
